:root {
  --primary-color: #4a6baf;
  --secondary-color: #f8f9fa;
  --text-color: #333;
  --light-gray: #f1f1f1;
  --border-color: #dee2e6;
  --human-msg-bg: #e9f5ff;
  --system-msg-bg: #f8f9fa;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: #fff;
  height: 100vh;
  overflow: hidden;
}

.container-fluid {
  height: 100vh;
  padding: 0;
}

.row {
  height: 100%;
  margin: 0;
}

/* 侧边栏样式 */
.sidebar {
  background-color: var(--secondary-color);
  border-right: 1px solid var(--border-color);
  padding: 15px;
  height: 100%;
  overflow-y: auto;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-item {
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.session-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.session-item.active {
  background-color: rgba(74, 107, 175, 0.1);
  font-weight: 500;
}

.session-item .delete-btn {
  opacity: 0;
  transition: opacity 0.2s;
}

.session-item:hover .delete-btn {
  opacity: 1;
}

/* 主内容区域 */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

.chat-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: #fff;
}

.chat-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.welcome-message {
  text-align: center;
  margin: auto;
  max-width: 600px;
  padding: 30px;
  background-color: var(--light-gray);
  border-radius: 12px;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
}

.message.human {
  background-color: var(--human-msg-bg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.system {
  background-color: var(--system-msg-bg);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-color);
}

.message p {
  margin-bottom: 0.5rem;
}

.message p:last-child {
  margin-bottom: 0;
}

.message pre {
  background-color: #f6f8fa;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
}

.message code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

/* 输入区域 */
.input-container {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  background-color: #fff;
}

#user-input {
  resize: none;
  overflow-y: auto;
  max-height: 120px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    width: 80%;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .message {
    max-width: 90%;
  }
}
